GtkStack: Avoid a few redundant notify emissions
authorMatthias Clasen <mclasen@redhat.com>
Sat, 7 Jun 2014 03:35:53 +0000 (23:35 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 9 Jun 2014 17:30:50 +0000 (13:30 -0400)
A few of the property setters were missing the
standard checks.

gtk/gtkstack.c

index 692aa2e20ea4d6b7acaf12210eb79f7776583b84..70611f44acd5dc78a6eefae8c1e63021abd682a1 100644 (file)
@@ -1315,6 +1315,9 @@ gtk_stack_set_transition_duration (GtkStack *stack,
 
   g_return_if_fail (GTK_IS_STACK (stack));
 
+  if (priv->transition_duration == duration)
+    return;
+
   priv->transition_duration = duration;
   g_object_notify_by_pspec (G_OBJECT (stack),
                             stack_props[PROP_TRANSITION_DURATION]);
@@ -1364,6 +1367,9 @@ gtk_stack_set_transition_type (GtkStack              *stack,
 
   g_return_if_fail (GTK_IS_STACK (stack));
 
+  if (priv->transition_type == transition)
+    return;
+
   priv->transition_type = transition;
   g_object_notify_by_pspec (G_OBJECT (stack),
                             stack_props[PROP_TRANSITION_TYPE]);